<!--Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title>衣橱整理后台登录</title>
<!-- Custom Theme files -->
<link href="resources/css/login/style.css" rel="stylesheet" type="text/css" media="all"/>
<!-- Custom Theme files -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">

<meta name="keywords" content="衣橱整理后台登录" />
	<script type="text/javascript" src="resources/js/common/jquery-2.1.1.min.js"></script>
	<style type="text/css">
		body{
			font-family: 'Montserrat', sans-serif;
			font-size: 100%;
			background-image: url('http://pd4ibujh5.bkt.clouddn.com/img/zcyun/180817/1725/f2b7084e54164d6d.png');
			background-size: cover;
		}
		.login-ic i.icon {
			background: url('resources/img/login/l.png')no-repeat 6px 6px;
		}
		.login-ic i {
			background: url('resources/img/login/m.png')no-repeat 6px 6px;
			width: 38px;
			height: 38px;
			float: left;
			/*-- agileits --*/
			display: inline-block;
		}

	</style>
</head>
<body>
<!--header start here-->
<div class="login-form">
			<div class="top-login">
				<span><img src="https://app.tctechec.com/image/admin/20181210092924.png" alt="" style="width: 85px;height: 85px;margin-left: 12px;margin-top: 12px;"/></span>
			</div>
			<h1>衣橱整理后台登录</h1>
			<div class="login-top">
			<form  action="/login/login" name="login" method="post">
				<div class="login-ic">
					<i ></i>
					<input type="text"  value="" id="nickName" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'User name';}"/>
					<div class="clear"> </div>
				</div>
				<div class="login-ic">
					<i class="icon"></i>
					<input type="password"  value="" id="pwd" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'password';}"/>
					<div class="clear"> </div>
				</div>

				<div class="log-bwn">

					<input type="login-submit" value="登&nbsp;录" style="text-align: center" onclick="loginRequest()">


				</div>
				</form>
			</div>
</div>
<!--header start here-->
</body>
<script>
    document.onkeyup = function (e) {//按键信息对象以函数参数的形式传递进来了，就是那个e
        var code = e.charCode || e.keyCode;  //取出按键信息中的按键代码(大部分浏览器通过keyCode属性获取按键代码，但少部分浏览器使用的却是charCode)
        if (code == 13) {
            loginRequest();
        }
    }

    function loginRequest() {
        var nickName = $('#nickName').val();
        var pwd = $('#pwd').val();

        jQuery.ajax({
            url: '/login/login',
            type: "post",
            data: {nickName: nickName, pwd: pwd},
            async: false,
            dataType: "json",
            success: function (data) {
                if (data.retCode == 1) {
                    window.location.href = "/home.html";
                }else {
                    alert("登录失败:" + data.retMsg);
                    return;
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown, XMLHttpResponse) {
                alert('操作异常，请联系管理员!')
            }
        });
    }
</script>
</html>